/**
 * 
 */
package com.vh.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.appfuse.model.BaseObject;


/**
 * @author Vijay Rajan
 *
 */
@Entity
public class Appointment extends BaseObject {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	Long id;
	String occasion;
	Date appDate;
	String comments;
	boolean completionF;
	
	
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Appointment [occasion=" + occasion + ", appDate=" + appDate
				+ ", comments=" + comments + ", completionF=" + completionF
				+ "]";
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Appointment other = (Appointment) obj;
		if (appDate == null) {
			if (other.appDate != null)
				return false;
		} else if (!appDate.equals(other.appDate))
			return false;
		if (comments == null) {
			if (other.comments != null)
				return false;
		} else if (!comments.equals(other.comments))
			return false;
		if (completionF != other.completionF)
			return false;
		if (occasion == null) {
			if (other.occasion != null)
				return false;
		} else if (!occasion.equals(other.occasion))
			return false;
		return true;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((appDate == null) ? 0 : appDate.hashCode());
		result = prime * result
				+ ((comments == null) ? 0 : comments.hashCode());
		result = prime * result + (completionF ? 1231 : 1237);
		result = prime * result
				+ ((occasion == null) ? 0 : occasion.hashCode());
		return result;
	}

	@Column(name="occasion", length=50)
	public String getOccasion() {
		return occasion;
	}

	public void setOccasion(String occasion) {
		this.occasion = occasion;
	}

	@Column
	public Date getAppDate() {
		return appDate;
	}

	public void setAppDate(Date appDate) {
		this.appDate = appDate;
	}
	
	@Column(name="comments", length=100)
	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {  
		this.comments = comments;
	}

	public boolean isCompletionF() {
		return completionF;
	}

	public void setCompletionF(boolean completionF) {
		this.completionF = completionF;
	}

	@Id @GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	
	public void setId(Long id) {
		this.id = id;
	}

}
